"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("../props.cjs"),o=e.defineComponent({name:"ep-correlation",props:t.default,emits:["update:modelValue"],setup(t,{emit:o}){const l=e.getCurrentInstance(),u=null==l?void 0:l.proxy,r=e.computed(()=>t.options.permission>0),a=e.computed({get:()=>t.modelValue,set(e){o("update:modelValue",e)}}),i=e.ref(!1);e.watch(i,e=>{e&&(s=t.modelValue||[])});let s=t.modelValue||[];return{fieldModel:a,isDetail:r,dialogVisible:i,onCallback:e=>{s=[...e]},onSave:()=>{const{limit:e,tip:l}=t.options;if(s.length>e)return null==u||u.$message.error(l||"超出最多关联数量"),!1;i.value=!1,o("update:modelValue",s)}}}});exports.default=o;
